# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>
pkgname=timescaledb
pkgver=1.7.0
pkgrel=0
pkgdesc="An open-source database designed to make SQL scalable for time-series data"
url="https://github.com/timescale/timescaledb"
arch=""
license="Apache-2.0"
makedepends="postgresql-dev cmake bash"
source="$pkgname-$pkgver.tar.gz::https://github.com/timescale/timescaledb/archive/$pkgver.tar.gz"

build() {
	# REGRESS_CHECKS=OFF - disable regress test
	# regress need https://github.com/timescale/timescaledb/blob/master/test/pg_isolation_regress.sh
	# which need to compile pg - https://github.com/timescale/timescaledb/issues/1655#issuecomment-578683986
	BUILD_FORCE_REMOVE=true ./bootstrap -DREGRESS_CHECKS=OFF
	make -C build USE-PGXS=1
}

check() {
	make -C build test
}

package() {
	make -C build USE_PGXS=1 DESTDIR="$pkgdir" install
}

sha512sums="532398ed5332faa10c5b3b6b983fc82c3f14bac8a3e5fdca6db41cceaf07bf6aa9e0d5042de0120881da82f2fe5286c23aadbae33d04dd45dc169a926645120d  timescaledb-1.7.0.tar.gz"
